/**
 * 线程id,name
 */
public class ThreadDemo13 {
    public static void main(String[] args) throws InterruptedException {
        Runnable runnable=new Runnable(){
            @Override
            public void run() {
                //得到执行当前任务线程
                Thread t=Thread.currentThread();
                //打印线程的id
                System.out.println(t.getName()+"线程ID:"+t.getId());
                //打印线程的名称
                System.out.println(t.getName()+"线程名称:"+t.getName());
                //打印线程优先级
                System.out.println(t.getName()+"线程优先级:"+t.getPriority());
            }
        };
        Thread thread=new Thread(runnable,"线程1");
        thread.start();

        Thread thread2=new Thread(runnable,"线程2");
        thread2.start();

        Thread thread3=new Thread(runnable,"线程3");
        thread3.start();
    }
}
